Digital images are commonly used in several applications such as, for example, in digital still cameras (DSCs).
A digital image includes of a matrix of elements, commonly referred to as bitmap. Each element of the matrix, which represents an elementary area of the image (a pixel or pel); is formed by several digital values that indicate corresponding components of the pixel.
Digital images typically undergo to processes of compression in order to increase the number of digital images that can be stored simultaneously, for example in the memory of a DSC. Furthermore, this enables transmission of digital images in an easier way and in a shorter time.
A compression method commonly used in standard applications is the compression according to the so-called JPEG standard, which is described in the specification CCITT T.81, 1992.
In the JPEG algorithm, blocks of pixels of a size of 8×8 bits are extracted from the digital image. Then, coefficients of the discrete cosine transform (DCT) are calculated for the components of each pixel block. The DCT coefficients are then quantized using corresponding quantization tables. The quantized DCT coefficients are then coded in order to obtain a compressed digital image, from which it is possible to extract later, via a decompression procedure, the corresponding original digital image.
In some applications, it is necessary to have available a memory of a substantially constant size to store each compressed digital image. This problem is particularly serious, for example in digital still cameras. In fact, in this case, it must be ensured that a minimum number of compressed digital images will be stored in the memory of the camera in order to guarantee that a minimum number of photos can be taken. Control of the compression factor, or rate control, is rather difficult in algorithms, such as JPEG, where the size of the compressed digital image depends upon the contents of the corresponding original digital image.
The JPEG methods for image compression hence envisage adjustment of a gain factor, which multiplies the quantization levels, or quantizers, contained in the quantization tables.
In particular, the purpose of rate-control procedures is to find the gain factor that enables creation of a compressed image with a pre-set dimension of the output file via control of the value of bits per pixel (bpp).
JPEG rate-control procedures can be divided into two categories: iterative ones and statistical ones.
The iterative procedures regulate, through iterative steps, the value of the gain factor in order to achieve the desired value of bits per pixel. At each step the resulting value of bits per pixel produced by the compression operation is compared with the desired value of bits per pixel, and the gain factor is then modified accordingly.
The statistical procedures evaluate, instead, the required value of gain factor G, taking into account the statistical relations between the desired value of bits per pixel and measurements performed on the digital image.
JPEG rate-control procedures can be classified also on the basis of constant precision or constant number of cycles.
In the case of constant-precision procedures, the cycle is repeated until the bitrate lies outside a pre-set precision range. The advantage of constant-precision procedures is that the precision is always guaranteed, but neither the time nor the consumption required by the compression operation are predictable.
Instead, in the case of a constant number of cycles, the precision that will be achieved is not predictable, whilst the time and power consumption are fixed and limited.
FIG. 1 shows a block diagram of a JPEG compression chain. In FIG. 1 the input image data, designated by the reference I, are supplied to a DCT block 10 and then to a quantization block 20. The quantization block 20 receives and uses a scaled quantization level {tilde over (Q)} that is calculated as the product of a gain factor G and a quantization level Q, according to the relation shown in Equation 1:{tilde over (Q)}=G·Q  (1)
The quantization level Q is selected in a quantization table 60.
The output quantized by the quantization block 20 is then supplied at input to a zigzag-ordering block 30 and then to a Huffman-coding block. The Huffman-coding block 40 uses the output signal of the zigzag-ordering block 30 and a Huffman table 50 to generate a JPEG compressed image O.
From documents EP-A-1 179 004, EP-A-1 173 036, EP-A-1 179 026 and A. Bruna, M. Mancuso, “JPEG compression factor control: a new algorithm”, ICCE International Conference on Consumer Electronics, 19-21 Jun. 2001, pp. 206-207, a JPEG rate-control procedure is known based upon the statistical properties of JPEG compression.
Said procedure is based upon the statistical relation between the values of bits per pixel and the gain factor. In particular, the relation considered is that established between the gain factor and the factor of bits per pixel when the image is compressed with fixed quantization tables.
Said procedure is a constant-cycle procedure that includes only one cycle, but includes two steps: a first step of recovery, or retrieval, and a second step of rate control. The first, retrieval, step is used for evaluating the parameters necessary to solve the statistical model.
The function that links the gain factor to the value of bits per pixel obtained carrying out a compression of the image with a pre-set factor is approximated via a parabola or a quadratic relation.
The main steps of such a procedure can then be summarized as follows:                calculating for all the images of the data base a gain factor (Gain*) that produces the desired value of bits per pixel (for example, through a bisection algorithm);        choosing an intermediate value of gain factor Int_G for performing a first compression, considering the value of gain factor that produces the minimum spreading of the pairs <bpp, Gain> on the set of images of the data base; and        using a parabolic function for interpolating the gain factor Gain* as a function of the value of bpp of the compressed-image data obtained applying the value of gain factor Int_G, according to the following equation:G=a·bp2+b·bp+c  (2)where a, b, c indicate the coefficients of the parabolic function.        
The retrieval step supplies at an output the intermediate value of gain factor Int_G for the first compression and the coefficients of the parabola (a, b, c). These values are set in relation with the images of the data base, with the desired value of bits per pixel, and with the subsampling parameters of luminance and chrominance (YUV). When some of these parameters are changed, the values for the changed settings must be retrieved.
For applications for example in digital still cameras, all the cases handled are previously considered and the corresponding settings are retrieved.
FIG. 2 is a schematic illustration of the main processing steps executed in the step of rate control with a statistical procedure, which comprise:
compressing the image data I, using quantization tables pre-scaled according to the intermediate values of gain factor Int_G in a JPEG-compression block 70;
using the value of bits per pixel bpp of the image supplied at output by the JPEG-compression block 70 to estimate a gain factor defined as statistical gain Gs by means of the parabolic function shown in Equation 2; in FIG. 2 said estimation step is represented by a graph 80 that represents the relation between the gain factor Gain* calculated on the image data base and the value of bits per pixel bpp; and
using the estimated gain factor Gs for a final JPEG-compression step similar to the step of compression of block 70, but not shown in FIG. 2.
The issues considered previously form the subject of extensive technical literature as testified, for example, by:
CCITT-Recommendation T.81: “information technology—Digital compression and coding of continuous tone still images”—Requirements and guidelines (1992);
“Sensors, cameras and applications for digital photography”—Proceedings of SPIE (Vol. 3650, January 1999);
Blaskaran, Konstantinides, “Image and video compression standards”—(pp. 86-93);
Nakagawa et al., “DCT-based still image compression ICS with Bit-Rate Control”—IEEE Trans. on Consumer Electronics, Vol. 38, No. 3, August 1992;
Wook Joong Lim et al., “A bit allocation method based on picture activity for still image coding”—IEEE Trans. on Image Proc., Vol. 8, No. 7, July 1999;
A. Bruna, M. Mancuso, “JPEG compression factor control: a new algorithm”, Consumer Electronics, 2001. ICCE. International Conference on Consumer Electronics, 19-21 Jun. 2001, Page(s): 206-207; and
Nakagawa et al.: DCT-based still image compression ICS with bit-rate control (IEEE 1992).
In applications where the desired value of bits per pixel is fixed at the moment of design or in any case pre-set, such as, for example, in digital still cameras in which usually a selector enables the quality of the image to be selected from among different levels of quality, with known systems it is, however, difficult to perform the compression with a single compression procedure performed just once, maintaining a good precision. The fact of having to re-apply the compression procedure a number of times entails a longer time for operation and higher power consumption.